package com.wyg.blog.service.serviceimpl;

import com.wyg.blog.mapper.SysRoleUserMapper;
import com.wyg.blog.model.user.SysRoleUser;
import com.wyg.blog.service.user.SysRoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:
 * @author: WYG
 * @time: 2020/6/21 21:24
 */
@Service
public class SysRoleUserServiceImpl implements SysRoleUserService {
    @Autowired
    SysRoleUserMapper sysRoleUserMapper;

    @Override
    public List<SysRoleUser> selectAll() {
        return sysRoleUserMapper.getAllRoleUser();
    }

    @Override
    public SysRoleUser selectRoleUserByUid(Integer uid) {
        return sysRoleUserMapper.getRoleUserByUId(uid);
    }

    @Override
    public boolean insertRoleUser(SysRoleUser sysRoleUser) {
        return sysRoleUserMapper.addRoleUser(sysRoleUser);
    }

    @Override
    public boolean renewRoleUser(SysRoleUser sysRoleUser) {
        return sysRoleUserMapper.updateRoleUser(sysRoleUser);
    }

    @Override
    public boolean removeRoleUser(Integer uid) {
        return sysRoleUserMapper.deleteRoleUserByUid(uid);
    }
}
